/**
 * 
 * @author Matthew Dye 
 * @version 1 6/17/11
 *
 */
public class TestData implements Comparable<TestData> {
	int data;
	private static int comparisons;
	
	public TestData(int data)
	{
		this.data = data;
	}
/**
 * Compares two TestData object to each other based upon the value of data
 * @param dataIn
 * 		The object to be compared to
 * @return
 * 		Integer based upon the comparison.	
 */
	@Override
	public int compareTo(TestData dataIn) {
		TestData.comparisons++;
		TestData testData = (TestData)dataIn;
		if(this.data < testData.data)
			return -1;
		else if(this.data > testData.data)
			return 1;
		else 
			return 0;
	}
/**
 * Compares two TestData objects to see if their data is equal using the compareTo() method
 * @param dataIn
 * 		Object being compared to
 * @return
 * 		Boolean based, true if match, false if not
 */
	@Override
	public boolean equals(Object dataIn)
	{
		if(this.compareTo((TestData)dataIn) == 0)
			return true;
		else
			return false;
	}
/**
 * Returns the string value of the data.
 * @return
 * 		String of data
 */
	@Override
	public String toString()
	{
		return Integer.toString(data);
	}
/**
 * set the value of the static variable comparisons
 * @param comparisons
 */
	public void setComparisons(int comparisons) {
		TestData.comparisons = comparisons;
	}
/**
 * Get the value of the static variable comparisons
 * 
 * @return
 * 		Value of comparisons
 */
	public int getComparisons() {
		return comparisons;
	}

}
